package ink.onei.production.controller;

import ink.onei.production.service.SystemInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.SpringVersion;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: dang
 * @Description: TODO
 * @Date: 2023/12/27 13:33 星期三
 */
@Controller
@RequestMapping("/")
public class CenterController {

    @Autowired
    private HttpServletRequest request;

    @RequestMapping({"/", "index"})
    public String index() {
        return "index";
    }


    @RequestMapping("/welcome")
    public String welcome() {

        Package pkg = this.getClass().getPackage();
        SystemInfo.getInstance(request);
        request.getServletContext().setAttribute("springVersion", SpringVersion.getVersion());
        request.getServletContext().setAttribute("pkgVersion", pkg.getImplementationVersion());
        return "welcome";
    }

    @RequestMapping("/plan/order-list")
    public String orderList() {
        return "order-list";
    }

    @RequestMapping("/plan/order-add")
    public String orderAdd() {
        return "order-add";
    }

    @RequestMapping("/plan/order-edit")
    public String orderEdit() {
        return "order-edit";
    }

    @RequestMapping("/plan/customer-add")
    public String customerAdd() {
        return "customer-add";
    }

    @RequestMapping("/plan/customer-del")
    public String customerDel() {
        return "customer-del";
    }

    @RequestMapping("/plan/customer-edit")
    public String customerEdit() {
        return "customer-edit";
    }

    @RequestMapping("/plan/customer-list")
    public String customerList() {
        return "customer-list";
    }

    @RequestMapping("/plan/goods-add")
    public String goodsAdd() {
        return "customer-add";
    }

    @RequestMapping("/plan/goods-del")
    public String goodsDel() {
        return "customer-del";
    }

    @RequestMapping("/plan/goods-edit")
    public String goodsEdit() {
        return "goods-edit";
    }

    @RequestMapping("/plan/goods-list")
    public String goodsList() {
        return "goods-list";
    }

    @RequestMapping("/dept/dept-list")
    public String intoDept() {
        return "dept-list";
    }

    @RequestMapping("/dept/staff-list")
    public String intoStaff() {
        return "staff-list";
    }
    @RequestMapping("/dept/dept-add")
    public String addDept() {
        return "dept-add";
    }
    @RequestMapping("/dept/staff-add")
    public String addStaff() {
        return "staff-add";
    }

    @RequestMapping("/dept/dept-edit")
    public String editDept() {
        return "dept-edit";
    }

    @RequestMapping("/dept/staff-edit")
    public String editStaff() {
        return "staff-edit";
    }
    @RequestMapping("/system/login")
    public String login() {
        return "login";
    }

    @RequestMapping("/system/admin-list")
    public String adminList() {
        return "admin-list";
    }

    @RequestMapping("/system/admin-add")
    public String adminAdd() {
        return "admin-add";
    }

    @RequestMapping("/system/admin-edit")
    public String adminEdit() {
        return "admin-edit";
    }

}
